/*
 * Created on 2 Apr 2007 by Andrew White
 */

package com.volatileshooter.networking.io.packets;

import java.net.SocketAddress;

import com.volatileshooter.networking.io.GameChannel;
import com.volatileshooter.networking.io.GamePacket;



/*
 * QuitPacket extends GamePacket and is designed alert the server that
 * a client has closed the game, the server then forwards this
 * packet on to remaining players to alert them that the player has left.
 * This packet may also be sent by the server to inform clients that
 * it is shutting down.
 */
public class QuitPacket extends GamePacket {
   
    /**
     * Creates a new instance of QuitPacket defining the packet event type,
     * and setting the weight to 'Heavy' to ensure that this packet will
     * arrive successfully.
     * 
     * @param clientId The clients Id
     * @param addr The socket address to send the packet to, or was received via
     */
    public QuitPacket(short clientId, SocketAddress addr) {
        super(clientId, addr);
        event = GameChannel.QUIT_EVENT;
        weight = GamePacket.HEAVY;
        // create empty payload
        payload = new byte[0];
    }

}
